﻿using System;
using System.Web;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;

using LTJ.Entity;
using LTJ.Common;
using LTJ.Config;
using LTJ.FrameWork;

namespace LTJ.WebPage.SystemManage.route
{
    /// <summary>
    /// 系统管理-线路详细
    /// </summary>
    public partial class routedetail : AdminPage
    {
        protected RouteBaseInfo rinfo = new RouteBaseInfo();
        protected int rid = SASRequest.GetInt("id", 0);

        /// <summary>
        /// 价格生成
        /// </summary>
        /// <param name="p1">底价</param>
        /// <param name="p2">港口价</param>
        /// <param name="p3">航线价</param>
        /// <returns></returns>
        protected string GetSeaPrice(string p1, string p2, string p3)
        {
            float price1 = TypeConverter.StrToFloat(p1, 0);
            int price2 = TypeConverter.StrToInt(p2, 0);
            int price3 = TypeConverter.StrToInt(p3, 0);

            if (price2 > 0) return (price1 + price2).ToString();
            else return (price1 + price3).ToString();
        }
        /// <summary>
        /// 其他价格生成
        /// </summary>
        protected string GetOtherPrice(string price, int ordernum)
        {
            string[] pricearray = price.Split(',');

            if (pricearray.Length < 3) return "0";
            else return pricearray[ordernum - 1] == "" ? "0" : pricearray[ordernum - 1];
        }

        #region Web 窗体设计器生成的代码

        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();
            base.OnInit(e);
        }

        private void InitializeComponent()
        {
            rinfo = RouteBases.GetRouteBaseInfo(rid);
        }

        #endregion
    }
}